package com.j180.mybatisplus_2demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.j180.mybatisplus_2demo.bean.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IUserDao extends BaseMapper<User> {

    @Select("select uid as id,uname as name,age as age from t_user where age>=#{minAge} and age<=#{maxAge}")
    public List<User> getUserByAge(@Param("minAge") int minAge,@Param("maxAge") int maxAge);
    @Select("select uid as id,uname as name,age as age from t_user where uname like #{name}")
    public List<User> getUserByName(@Param("name") String name);

}
